package NoRain.Wxt;

import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import java.io.IOException;

/**
 * Created by Administrator on 2016-04-23.
 */
public class HelloServlet extends javax.servlet.http.HttpServlet {

    private ServletConfig _config;

    public void init(ServletConfig config) {
        this._config = config;
    }

    protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {

    }

    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {

        response.setHeader("content-type", "text/html;charset=UTF-8");
        response.getWriter().write("Hello Servlet \n");
        response.getWriter().write("\n名称：" + _config.getInitParameter("name"));
        response.getWriter().write("\n用户名：" + _config.getInitParameter("username"));
        response.getWriter().write("\n密码：" + _config.getInitParameter("password"));


    }
}
